/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.insurenceStep2.Controller;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Yogesh
 */
public class InsuranceImageStore {

    public InsuranceImageStore(String pic,String activationCode,String fileName,String dir) {

                try {
 
			String content = pic;
 
			File file = new File("VehicleHai/"+activationCode+"/"+dir+"/"+fileName);
 
			// if file doesnt exists, then create it
			if (!file.exists()) {
				file.createNewFile();
			}
 
			FileWriter fw = new FileWriter(file.getAbsoluteFile());
			BufferedWriter bw = new BufferedWriter(fw);
			bw.write(content);
			bw.close();
 
			System.out.println("Done");
 
		} catch (IOException e) {
			e.printStackTrace();
		}



    }


    

}
